package com.boho.system.action;


             
/**
 * 
 *
 * @File name:  QueryTSysRoleByPagerAction.java 
 * @Create on:  2010-05-10 11:27:234
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
            
import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.po.ComboPager;
import cn.boho.framework.po.Pager;
import cn.boho.framework.service.MessageService;

import com.boho.system.service.RoleService;



public class QueryTSysRoleByPagerAction extends ActionImp {
	private Pager pager=null;
	private int pageSize = 100;
	private int currentPage = 1;
	private String rolename = "";
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		atx.setErrorContext("BOHO_COMMON_1004", MessageService.getMessage("BOHO_COMMON_1004"),"【系统角色信息分页列表】" ,ex);
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		pager = new Pager(pageSize, currentPage);
		ComboPager cp = RoleService.queryRoleByRoleName(atx, pager, rolename);
		atx.setValue("T_SYS_ROLE", cp);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		if(atx.getStringValue("PAGE_SIZE")!=null&&!atx.getStringValue("PAGE_SIZE").equals("")){
			pageSize = new Integer(atx.getStringValue("PAGE_SIZE"));
		}
		if(atx.getStringValue("CURRENT_PAGE")!=null&&!atx.getStringValue("CURRENT_PAGE").equals("")){
			currentPage = new Integer(atx.getStringValue("CURRENT_PAGE"));
		}
		rolename = atx.getStringValue("ROLE_NAME", "").trim();
		return 1;
	}
}
